﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics;

namespace Jet.Dal.EF.Tests.DataObjects
{
	/// <summary>
	/// Information about customer from Northwind database
	/// </summary>
	[DebuggerDisplay("{EmployeeID} - {LastName}")]
	[Table("Employees")]
	public class Employee
	{
		[Key]
		public int EmployeeID { get; set; }

		[Column]
		public string LastName { get; set; }

		[Column]
		public string FirstName { get; set; }

		[Column]
		public string Title { get; set; }

		[Column]
		public string TitleOfCourtesy { get; set; }

		[Column]
		public DateTime BirthDate { get; set; }

		[Column]
		public DateTime HireDate { get; set; }

		[Column]
		public string Address { get; set; }

		[Column]
		public string City { get; set; }

		[Column]
		public string Region { get; set; }

		[Column]
		public string PostalCode { get; set; }

		[Column]
		public string Country { get; set; }

		[Column]
		public string HomePhone { get; set; }

		[Column]
		public string Extension { get; set; }

		[Column]
		public byte[] Photo { get; set; }

		[Column]
		public string Notes { get; set; }

		[Column]
		public int? ReportsTo { get; set; }

		[Column]
		public string PhotoPath { get; set; }

		[ForeignKey("ReportsTo")]
		public virtual Employee Interface { get; set; }

		public virtual ICollection<Employee> Subordibates { get; set; }

		public virtual ICollection<Order> Orders { get; set; }

		/// <summary>
		/// Display some information about customer
		/// </summary>
		public override string ToString()
		{
			return String.Format("Employee ID:{0}, {1} {2}, Birthdate:'{3}'", EmployeeID, FirstName, LastName, BirthDate);
		}

	}
}
